
"""
This module creates and handles the window for the pygame version of dynamia.
"""
import pygame

class Window(object):
    def __init__(self):
        pygame.display.set_caption('Dynamia')
        self.screen = pygame.display.set_mode((600, 600))
        self.background = pygame.Surface(self.screen.get_size())
        self.background = self.background.convert()
        self.display = None
        
    
    def set_display(self, display):
        self.display = display
        self.update()
    
    def update(self):
        if self.display:
            self.display.update()
            self.background.blit(self.display, (0, 0))
        self.screen.blit(self.background, (0,0))
        pygame.display.update()
        pygame.display.flip()
    
        


    
    
    
   
    
    






